import java.util.*;
import game.*;
public class TagInterface{
	
	public static void main(String[] args){
		Game game = new Game();
		Scanner in = new Scanner(System.in);
		
		String input; //this is the variable that is used to take in the users commands and pass them to excecuteVerb() 
		String output; //this is the variable that is used to output what the game.excecuteVerb(input) does to the input 
	/*
		System.out.println("Type /save and /quit to save or quit your game.\n");
		do{
			System.out.println("Please enter a file to load: ");
			input = in.nextLine();
			game = Game.load(input);
			}while(game == null);
	*/
		System.out.println("Game loaded successfully!\n");
    TestGame tg = new TestGame();
		game = tg.g;
		do{
			System.out.println("Enter a command: ");
			input = in.nextLine();
			
			if(input.equals("/save")){
				System.out.println("Please enter a filename: ");
				input = in.nextLine();
				game.save(input);
				System.out.println("Your game has been saved.");
				}
			else if(input.equals("/quit")){
				System.out.println("Would you like to save your game (Yes or No)?");
				String choice = in.nextLine();
				do{
					if(choice.equals("Yes") || choice.equals("yes")){
						System.out.println("Please enter a filename: ");
						String fileName = in.nextLine();
						game.save(fileName);
						System.out.println("Your game has been saved.");
						break;
						}
					else if(choice.equals("No") || choice.equals("no")){
						break;
						}
					else{
						System.out.println("Invalid command.  Game will not save.");
						break;
						}
					}while(true);
				}
			else{
				output = game.executeVerb(input.toLowerCase());
				if(!output.equals("")){
					System.out.print(output); // change this line
					}
				}
			}while(!input.equals("/quit"));
		
		System.out.println("Thanks for playing!");
	}
}
	

	